<!--
 * @Author: wanchunyi 1536793586@qq.com
 * @Date: 2022-11-19 15:07:44
 * @LastEditors: wanchunyi 1536793586@qq.com
 * @LastEditTime: 2023-02-23 15:18:41
 * @FilePath: \virtualHome\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  mounted() {
    this.$nextTick(function () {
      //富文本复制功能
      document.addEventListener("paste", (e) => {
        // 阻止默认的复制事件
        if (e.target.id === "edit" || e.target.id === "edits") {
          e.preventDefault();
          let txt = "";
          let range = null;
          // 获取复制的文本
          txt = e.clipboardData.getData("text/plain");
          // 获取页面文本选区
          range = window.getSelection().getRangeAt(0);
          // 删除默认选中文本
          range.deleteContents();
          // 创建一个文本节点，用于替换选区文本
          let pasteTxt = document.createTextNode(txt);
          // 插入文本节点
          range.insertNode(pasteTxt);
          // 将焦点移动到复制文本结尾
          range.collapse(false);
        }
      });
          Date.prototype.toLocaleString = function () {
      return (
        this.getFullYear() +
        "-" +
        (this.getMonth() + 1) +
        "-" +
        this.getDate() +
        " " +
        this.getHours() +
        ":" +
        this.getMinutes() +
        ":" +
        this.getSeconds()
      );
    };
    });
  },
};
</script>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  user-select: none;
}
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
